<template>
  <div>
    <left-menu></left-menu>
    <IndexBanner></IndexBanner>
    <IndexProduct></IndexProduct>
    <Servies></Servies>
  </div>
</template>

<script>
import {getUser} from "../api/home";
import LeftMenu from "../components/Index/left-menu";
import IndexBanner from "../components/Index/Index-Banner";
import IndexProduct from "../components/Index/Index-Product";
import Servies from "../components/base/Servies";

export default {
  name: 'index',
  components: {Servies, IndexProduct, IndexBanner, LeftMenu},
  data () {
    return {
      username: ''
    }
  },
  mounted () {
    getUser().then(res => {
      const data = res.data.data
      if (data) {
        this.$message.success(`欢迎回来 ${data.username}`)
      } else {
        this.$message('登陆错误')
      }
    })
  }
}
</script>

<style lang="scss" scoped>

</style>
